package com.scvtc.controller.teacher;

import com.scvtc.domain.ResResult;
import com.scvtc.domain.dto.teacher.social.TeacherSocialServiceDto;
import com.scvtc.domain.vo.PageVo;
import com.scvtc.domain.vo.teacher.social.TeacherSocialServiceVo;
import com.scvtc.service.teacher.TeacherSocialServiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 教师社会服务(TeacherSocialService)表控制层
 *
 * @author yiFei
 * @since 2022-06-02 16:17:10
 */
@Api(tags = "教师社会服务(TeacherSocialService)")
@RestController
@RequestMapping("teacherSocialService")
public class TeacherSocialServiceController {
    /**
     * 教师社会服务(TeacherSocialService)对象
     */
    @Autowired
    private TeacherSocialServiceService teacherSocialServiceService;


    @GetMapping("/list")
    @ApiOperation("查询教师服务信息")
    public ResResult<PageVo<List<TeacherSocialServiceVo>>> getAllTeacherSocialService(
            @RequestParam(defaultValue = "1") Long current,
            @RequestParam(defaultValue = "10") Long size,
            TeacherSocialServiceVo teacherSocialServiceVo) {
        return teacherSocialServiceService.getAllTeacherSocialService(current, size, teacherSocialServiceVo);
    }

    @PostMapping("/")
    @ApiOperation("添加单个教师服务")
    public ResResult<?> addTeacherSocialService(@RequestBody TeacherSocialServiceDto teacherSocialServiceDto) {
        return teacherSocialServiceService.addTeacherSocialService(teacherSocialServiceDto);
    }

    @PutMapping("/")
    @ApiOperation("修改单个教师服务")
    public ResResult<?> updateStudent(@RequestBody TeacherSocialServiceDto teacherSocialServiceDto) {
        return teacherSocialServiceService.updateTeacherSocialService(teacherSocialServiceDto);
    }
    
    @DeleteMapping("/")
    @ApiOperation("删除一条教师服务信息")
    public ResResult<?> deleteTeacherSocialService(Long id) {
        return teacherSocialServiceService.deleteTeacherSocialService(id);
    }

    @DeleteMapping("/multiple")
    @ApiOperation("删除多条教师服务信息")
    public ResResult<?> deleteMultipleTeacherSocialService(Long[] ids) {
        return teacherSocialServiceService.deleteMultipleTeacherSocialService(ids);
    }


}

